package com.duxd.springsecurityfinal.springsecurityfinal.pojo;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.StringJoiner;
import java.util.stream.Collectors;

/**
 * @author dong
 * @date 2022/1/10 0010
 */

public class User implements Serializable {

    private String name;
    private String password;

    public User() {
    }

    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", User.class.getSimpleName() + "[", "]")
                .add("name='" + name + "'")
                .add("password='" + password + "'")
                .toString();
    }
    public static List<User> buildList(String... names){
        return Arrays.stream(names).map(User::new).collect(Collectors.toList());
    }


}
